{layout name="layout/main" /}

<blockquote class="layui-elem-quote quoteBox">
    <form class="layui-form" id="searchTableForm">
        <div class="layui-inline">
            <div class="layui-input-inline">
                <input name="title" type="text" class="layui-input" placeholder="标题"/>
            </div>
            <div class="layui-input-inline">
                <input name="desc" type="text" class="layui-input" placeholder="简介"/>
            </div>
            <div class="layui-input-inline">
                <select name="status" id="status">
                    <option value="">状态</option>
                    {volist name='status_list' id="vo"}
                    <option value="{$vo.id}">{$vo.title}</option>
                    {/volist}
                </select>
            </div>
            <a class="layui-btn search_btn" lay-submit lay-filter="tablelistReload" id="tablelistReload">搜索</a>
        </div>
    </form>
</blockquote>

<div id="boxTableNone">
    <script type="text/html" id="tplToolbar">
        <div class="layui-btn-container">
            <button class="layui-btn layui-btn-sm" id="buttonAdd" lay-event="buttonAdd">
                <i class="layui-icon"></i>添加
            </button>
            <button class="layui-btn layui-btn-sm" id="batchDel" lay-event="batchDel">批量删除</button>
        </div>
    </script>

    <script type="text/html" id="toolbarHtml">
        <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
    </script>

    <table class="layui-hide layui-table x-admin" id="tablelist" lay-filter="tablelist"></table>
</div>

<script type="text/javascript" src="/static/vfs/tablelistobj.js"></script>
<script>
    layui.use(['form', 'table', 'jquery', 'layer', 'upload', 'util'], function () {
        var table = layui.table;
        var form = layui.form;
        var layer = layui.layer;
        var util = layui.util;
        var $ = layui.jquery;
        //渲染列表
        tablelistobj.$ = $;
        tablelistobj.tool_obj = {
            lists: {href: "{:url('admin/Job/lists')}", title: '列表'},
            add: {href: "{:url('admin/Job/add')}", title: '添加'},
            edit: {href: "{:url('admin/Job/edit')}", title: '编辑'},
            del: {href: "{:url('admin/Job/del')}", title: '删除'},
            param: {href: "{:url('admin/Job/info')}", title: '详情'},
        };
        tablelistobj.cols = [[
            {field: 'id', type: 'checkbox', width: 80},
            {field: 'id', width: 80, title: 'ID', sort: true},
            {field: 'title', title: '标题'},
            {field: 'desc', title: '简介'},
            {field: 'status_name', title: '状态',},
            {field: '', title: '操作', align: 'center', toolbar: '#toolbarHtml', width: 150}
        ]];
        tablelistobj.limit = 10;
        tablelistobj.render(table);
        //搜索表单
        tablelistobj.search(table, form);
        //操作按钮
        tablelistobj.form_width = 1000;
        tablelistobj.form_height = 600;
        tablelistobj.tool(table, layer);
        //头工具栏事件
        tablelistobj.toolbar(table, layer);
        //一些自定义事件
    });
</script>
